import { CanvasTexture, Texture, TextureLoader } from "three";
import { TCanvasTextureEditor } from "./tCanvasTextureEditor";

const texture: TextureLoader = new TextureLoader();

export const pictrueTexture: Texture = texture.load("/basecolor.png")

// 相框颜色贴图
export const cameraFrameColorTexture: Texture = texture.load("/camera-frame/texture/Wood066_1K-JPG_Color.jpg")
// 相框粗糙度贴图
export const cameraFrameRoughnessTexture: Texture = texture.load("/camera-frame/texture/Wood066_1K-JPG_Roughness.jpg")
// 相框置换贴图
export const cameraFrameDisplacementTexture: Texture = texture.load("/camera-frame/texture/Wood066_1K-JPG_Displacement.jpg")
// 相框法线贴图
export const cameraFrameNormalTexture: Texture = texture.load("/camera-frame/texture/Wood066_1K-JPG_NormalDX.jpg")

let canvasInstance = new TCanvasTextureEditor(1920, 1080).draw((ctx) => {
    ctx.fillStyle = 'red'
    ctx.textAlign='center'
    ctx.textBaseline='middle'
    ctx.font='50px 微软雅黑'
    ctx.translate(1920 / 2,1080 / 2)

    ctx.beginPath()
    ctx.fillText("author: 小高",0,0)
    ctx.closePath()

    ctx.beginPath()
    ctx.fillText("ID: 1",0,42)
    ctx.closePath()

    ctx.beginPath()
    ctx.fillText("date: 2023.10.23",0,84)
    ctx.closePath()
})
export const tipsTexture = new CanvasTexture(canvasInstance.canvas)